﻿using System.Security.Principal;

namespace Inovout.Security
{
    public class UserIdentity : GenericIdentity
    {
        public IUser User { get; private set; }

        protected internal UserIdentity(IUser user, bool isAuthenticated = false)
            : this(user, isAuthenticated, "Windows")
        {
        }
        internal UserIdentity(IUser user, bool isAuthenticated, string authenticationType)
            : base(user.Name)
        {
            this.User = user;
            this.isAuthenticated = isAuthenticated;
            this.authenticationType = authenticationType;
        }
        private readonly string authenticationType;
        public override string AuthenticationType
        {
            get { return authenticationType; }
        }

        private bool isAuthenticated;
        public override bool IsAuthenticated
        {
            get
            {
                return isAuthenticated;
            }
        }
    }
}
